package com.emep.emeptime.service;

import com.emep.emeptime.entity.SysAqiLevel;
import com.emep.emeptime.entity.SysAreaInfo;
import com.emep.emeptime.repository.SysAqiLevelRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author wangcc
 * @version V1.0
 * @Description: 颜色
 * @date 2018/3/27  14:36
 */
@Service
@Slf4j
public class SysAqiLevelService {


    @Resource
    private SysAqiLevelRepository sysAqiLevelRepository;


    /**
     *
     * 根据AreaName查询行政区划
     *
     * @param areaName
     * @return
     */
    public SysAqiLevel findAreaByAreaName(String areaName){
        SysAqiLevel areaInfo = null;
        try {
            areaInfo = sysAqiLevelRepository.findSysAqiLevelByLevel(areaName);
        }catch (Exception e){
            log.error(e.getLocalizedMessage());
        }
        return areaInfo;
    }
}
